# !/bin/bash
source /home/jboss/east/eastShell/origion.sh
<#noparse>pwd=`echo -n ${password} | base64 -d`</#noparse>
<#noparse>mysql -h${ip} -P${port} -u${username} -p${pwd} -D${username} <<EOF</#noparse>
user model;
delete from ${tableInfo.tableName} where data_date = <#noparse>'$2'</#noparse>;
<#noparse>LOAD DATA LOCAL INFILE "$1"</#noparse>
INTO TABLE ${tableInfo.tableName}
character set utf8
FIELDS TERMINATED by '|'
LINES TERMINATED by '\n'
IGNORE 2 LINES
<#assign igfields=["DATA_DATE","DATA_ID"]/>
(<#list tableFields as tableField><#if igfields?seq_contains(tableField.columnName)><#else>${tableField.columnName}<#if tableField_has_next>,</#if></#if></#list>)
update ${tableInfo.tableName} set data_date = '$2' where data_date is null;
delete from ${tableInfo.tableName} where cif_id = 'T';
EOF